<?php

/* ========================================================================= */
/* This file is part of the HypnoPHP Framework Library                       */
/* Copyright (c) 2009-2010, Radu Buzea                                       */
/* ========================================================================= */

/**
* @author Radu Buzea
* @copyright Copyright (c) 2009-2010, Radu Buzea (www.hypnosis.ro)
* @license GNU Lesser General Public License (www.gnu.org/copyleft/lesser.html)
* @package HypnoPHP
*/

// ============================================================================
// Final class: HManager
// ============================================================================

final class HManager extends HBaseController
{

	public function hypnophpInfoAction()
	{
		$php_extensions = get_loaded_extensions();
		$php_ini_settings = ini_get_all();
		$php_extensions_ini = array();
		$php_other_ini = array();
		foreach($php_ini_settings as $ini_key => $ini_set) {
			$p = strpos($ini_key, '.');
			if ($p !== false) {
				$key_prefix = substr($ini_key, 0, $p);
				if (in_array($key_prefix, $php_extensions)) {
					$key_parameter = substr($ini_key, $p + 1);
					$php_extensions_ini[$key_prefix][$key_parameter] = $ini_set;
				} else {
					$php_other_ini[$key_prefix] = $ini_set;
				}
			} else {
				$php_other_ini[$ini_key] = $ini_set;
			}
		}
		unset($php_extensions);
		unset($php_ini_settings);
		ksort($php_extensions_ini);
		ksort($php_other_ini);
		out($php_extensions_ini);
		phpinfo();
		die('<img src="' . $_SERVER['PHP_SELF'] .
		 '?=' . php_logo_guid() . '" alt="PHP Logo !" />');
	}

	public function hypnophpManagerAction()
	{
		return "<h2>" . __CLASS__ . "::" . __FUNCTION__ . "<br />NOT IMPLEMENTED</h2>";
	}



}